
/**
 * Created by luojie on 2018/3/12.
 * 路由配置。
 */

import React, { Component } from 'react';
import { HashRouter as Router, Route, Switch, Redirect } from 'react-router-dom';
import { Modules} from "./config/routeConfig";

class App extends Component {
  componentDidMount() {

  }
  render() {
    return (
          <Router>
            <Switch >
              {
                Modules.map((item,index)=>{
                  return(
                    <Route path = {item.path} key = {`path${index}`} component = {item.comp}></Route>
                  )
                })
              }
              <Redirect to='/index' />

            </Switch>
          </Router>

    );
  }
}

export default App;
